package com.ai.bitcoin.schedule.task;

import com.ai.bitcoin.jpa.dao.BccBasicInfoDao;
import com.ai.bitcoin.weixin.push.WxPushHelper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @description: 生成所有币报告放入缓存
 * @author: gulj
 * @create: 2018-06-15 00:14
 **/
@Slf4j
@Component
public class HtmlReportGenerateAllTask {


    @Autowired
    private WxPushHelper wxPushHelper;
    @Autowired
    private BccBasicInfoDao bccBasicInfoDao;

    /**
     * 生成报告
     */
    @Scheduled(cron = "1 0 0 ? * *")
    public void execute() {
        log.info("*****************开始生成所有币的报告*************");
        List<String> list = bccBasicInfoDao.findAllBccId();
        wxPushHelper.batchGenerateReport(list);
        log.info("*****************结束生成所有币的报告*************");
    }

}
 
